export const routerConfig = [
  {
    path: "/warehouse",
    name: "Warehouse",
    meta: {
      title: "工具室",
      icon: "ep:house"
    },
    redirect: "/warehouse/index",
    children: [
      {
        path: "/warehouse/index",
        name: "WarehouseIndex",
        meta: { title: "工具室" }
      }
    ]
  },
  {
    path: "/tool",
    name: "tool",
    meta: {
      title: "工具管理",
      icon: "ep:help"
    },
    children: [
      {
        path: "/tool/list",
        name: "ToolIndex",
        component: "tools/list/index.vue",
        meta: { title: "工具管理", keepAlive: true }
      },
      {
        path: "/tool/detail",
        component: "tools/detail/index.vue",
        name: "ToolDetailIndex",
        meta: { title: "工具详情", showLink: false, activePath: "/tool/list" }
      }
    ]
  },
  {
    path: "/facility",
    name: "Facility",
    meta: {
      title: "工具室设施",
      icon: "ep:scale-to-original"
    },
    children: [
      {
        path: "/facility/index",
        component: "facility/index.vue",
        name: "FacilityIndex",
        meta: { title: "工具室设施" }
      }
    ]
  },
  {
    path: "/depot",
    name: "Depot",
    meta: {
      title: "库存管理",
      icon: "ep:message-box"
    },
    children: [
      {
        path: "/depot/list",
        name: "DepotList",
        meta: { title: "库存查询", showParent: true },
        component: "depot/list/index.vue"
      },
      {
        path: "/depot/stockTake",
        name: "DepotStockTake",
        redirect: "/depot/stockTake/list",
        meta: { title: "盘点记录", showLink: true },
        children: [
          {
            path: "/depot/stockTake/list",
            name: "DepotStockTakeList",
            meta: { title: "盘点记录" },
            component: "depot/stockTake/list/index.vue"
          },
          {
            path: "/depot/stockTake/facility",
            component: "depot/stockTake/facilitys/index.vue",
            meta: {
              title: "工具库存盘点",
              showLink: false,
              activePath: "/depot/stockTake"
            },
            name: "DepotStockTakeFacility"
          },
          {
            path: "/depot/stockTake/tool",
            component: "depot/stockTake/tools/index.vue",
            meta: {
              title: "盘点异常工具",
              showLink: false,
              activePath: "/depot/stockTake"
            },
            name: "DepotStockTakeTool"
          }
        ]
      }
    ]
  },
  {
    path: "/record",
    name: "Record",
    meta: {
      title: "借还记录",
      icon: "ep:connection"
    },
    children: [
      {
        path: "/record/list",
        name: "RecordList",
        meta: { title: "借还记录" }
      },
      {
        path: "/record/unReturn",
        name: "RecordUnReturn",
        meta: { title: "未归还" }
      }
    ]
  },
  {
    path: "/overhaul",
    name: "Overhaul",
    meta: {
      title: "定检报修",
      icon: "ep:clock"
    },
    children: [
      {
        path: "/overhaul/inspect",
        name: "OverhaulInspect",
        meta: {
          title: "检查记录"
        }
      },
      {
        path: "/overhaul/repair",
        name: "OverhaulRepair",
        meta: {
          title: "报修记录"
        }
      },
      {
        path: "/overhaul/maintain",
        name: "OverhaulMaintain",
        meta: {
          title: "维修记录"
        }
      }
    ]
  },
  {
    path: "/toolFix",
    name: "ToolFix",
    meta: {
      title: "工具维护",
      icon: "ep:box"
    },
    children: [
      {
        path: "/toolFix/list",
        name: "ToolFixList",
        meta: { title: "维护清单" },
        component: "/toolFix/list/index.vue"
      },
      {
        path: "/toolFix/record",
        name: "ToolFixRecord",
        meta: { title: "维护记录" },
        component: "/toolFix/record/index.vue"
      }
    ]
  },
  {
    path: "/statistics",
    name: "Statistics",
    meta: {
      title: "数据统计",
      icon: "ep:data-line"
    },
    children: [
      {
        path: "/statistics/staff",
        name: "StatisticsStaff",
        meta: { title: "人员借还统计" },
        children: [
          {
            path: "/statistics/staff/list",
            name: "StatisticsStaffList",
            meta: { title: "人员借还统计" },
            component: "statistics/staff/list/index.vue"
          },
          {
            path: "/statistics/staff/detail",
            name: "StatisticsStaffDetail",
            meta: { title: "人员工具记录", showLink: false },
            component: "statistics/staff/detail/index.vue"
          }
        ]
      },
      {
        path: "/statistics/toolUse",
        name: "StatisticsToolUse",
        meta: { title: "工具使用统计" }
      },
      {
        path: "/statistics/inspect",
        name: "StatisticsInspect",
        meta: { title: "工具定检统计" }
      },
      {
        path: "/statistics/facility",
        name: "StatisticsFacility",
        meta: { title: "货架统计" }
      },
      {
        path: "/statistics/warn",
        name: "StatisticsWarn",
        meta: { title: "报警统计" },
        children: [
          {
            path: "/statistics/warn/list",
            name: "StatisticsWarnList",
            meta: { title: "报警统计" },
            component: "statistics/warn/list/index"
          },
          {
            path: "/statistics/warn/record",
            name: "StatisticsWarnRecord",
            component: "statistics/warn/record/index",
            meta: { title: "报警记录", showLink: false }
          }
        ]
      }
    ]
  },
  {
    path: "/system",
    name: "System",
    meta: {
      title: "系统管理",
      icon: "ep:setting"
    },
    children: [
      {
        path: "/system/user",
        component: "/system/user/index",
        name: "SystemUser",
        meta: { title: "用户管理" }
      },
      {
        path: "/system/role",
        component: "/system/role/index",
        name: "SystemRole",
        meta: { title: "角色管理" }
      },
      {
        path: "/system/dept",
        name: "SystemDept",
        meta: { title: "组织管理" }
      },
      {
        path: "/system/operlog",
        name: "SystemOperlog",
        meta: { title: "系统日记" }
      }
    ]
  }
];

export const getAsyncRoutes = () =>
  new Promise(resolve => {
    resolve({ data: routerConfig });
  });
